﻿/// <reference path="../../sage/sage.util.js" />
/// <reference path="../painters/fourkill.painter.ZZ.singletons.js" />

var ThreeDimensionalObject = PolyObject.extend({
    initialize: function initialize() {
        PolyObject.initialize.call(this);
        this.color = "rgb(" + (255 - util.random(0, 20)) + ", " + (255 - util.random(0, 20)) + ", " + (255 - util.random(0, 20)) + ")";
        this.x = 0;
        this.y = 0;
        this.z = 0;
    },
    addPolygon: function addPolygon() {
        var poly = Poly.newInstance();
        for (var i = 0; i < arguments.length; i++) {
            var pa = arguments[i];
            poly.points.push(Point3D.newInstance(this.x + pa[0], this.y + pa[1], this.z + pa[2]))
        }
        this.polygons.push(poly);
    },
    getPainter: function getPainter() { return Painters.ThreeDimensional; }
});